using System.Collections;
using UnityEngine;

public class MineralSpark : MonoBehaviour
{
	[SerializeField]
	private Mineral mineral;

	[SerializeField]
	private GameObject[] goldSpark;

	private IEnumerator Start()
	{
		if (Controller.instance.GetMineral == mineral)
		{
			int index = UnityEngine.Random.Range(0, goldSpark.Length);
			goldSpark[index].SetActive(value: true);
			Animation[] animations = goldSpark[index].GetComponentsInChildren<Animation>(includeInactive: true);
			for (int i = 0; i < animations.Length; i++)
			{
				float time = UnityEngine.Random.Range(0f, 1f);
				yield return new WaitForSeconds(time);
				animations[i].gameObject.SetActive(value: true);
			}
		}
	}
}
